package day10;

import java.util.Scanner;

/**
 * 题目:密码强度等级判断
 * https://www.nowcoder.com/practice/52d382c2a7164767bca2064c1c9d5361?tpId=37&&tqId=21310&rp=1&ru=/activity/oj&qru=/ta/huawei/question-ranking
 */
public class Main2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
            String str = scanner.nextLine();
            int sum1 = getLen(str);
            int sum2 = getChar(str);
            int sum3 = getNum(str);
            int sum4 = getsym(str);
            int result = sum1+sum2+sum3+sum4;
            if(sum2 == 20 && sum3 != 0 && (sum4 == 25) || (sum4 == 10)) {
                result += 5;
            } else if(sum2 == 10 && sum3 != 0 && (sum4 == 25) || (sum4 == 10)) {
                result += 3;
            } else if(sum2 != 0 && sum3 != 0) {
                result += 2;
            } else {
                result += 0;
            }
            if(result >= 90) {
                System.out.println("VERY_SECURE");
            } else if(result >= 80) {
                System.out.println("SECURE");;
            } else if(result >= 70) {
                System.out.println("VERY_STRONG");
            } else if(result >= 60) {
                System.out.println("STRONG");
            } else if(result >= 50) {
                System.out.println("AVERAGE");
            } else if(result >= 25) {
                System.out.println("WEAK");
            } else if(result >= 0) {
                System.out.println("VERY_WEAK");
            }
    }

    public static int getLen(String str) {
        if(str.length() <= 4) return 5;
        else if(str.length() >= 5 && str.length() <= 7) return 10;
        else if(str.length() >= 8) return 25;
        else return 0;
    }

    public static int getChar(String str) {
        int small = 0;
        int big = 0;
        for (int i = 0; i < str.length(); i++) {
            if(str.charAt(i) >= 65 && str.charAt(i) <= 90) {
                big++;
            }
            if(str.charAt(i) >= 97 && str.charAt(i) <= 122) {
                small++;
            }
        }
        if(small >0 && big > 0) {
            return 20;
        } else if(small > 0 || big > 0) {
            return 10;
        }else {
            return 0;
        }
    }

    public static int getNum(String str) {
        int result = 0;
        for (int i = 0; i < str.length(); i++) {
            if(str.charAt(i) - '0' >= 0 && str.charAt(i) - '0' <= 9) {
                result++;
            }
        }
        if(result > 1) {
            return 20;
        } else if(result == 1) {
            return 10;
        }else {
            return 0;
        }
    }

    public static int getsym(String str) {
        int result = 0;
        for (int i = 0; i < str.length(); i++) {
            if(!(str.charAt(i) - '0' >= 0 && str.charAt(i) - '0' <= 9)
                    && !(str.charAt(i) >= 97 && str.charAt(i) <= 122)
                    && !(str.charAt(i) >= 65 && str.charAt(i) <= 90)) {
                result++;
            }
        }
        if(result > 1) {
            return 25;
        } else if(result == 1) {
            return 10;
        } else {
            return 0;
        }
    }
}
